
#pragma once

#include "DBManager/IRepository/Input/Dynamic/IRANDPSRepository.h"
#include "DBManager/Repository/HDF5/Base/SingleSetRepositoryBase.h"
#include "highfive/H5File.hpp"

template <>
inline HighFive::DataType
HighFive::create_datatype<SG::DataStructure::FEM::RANDPSData>() {
  HighFive::CompoundType compoundType = {
      {"SID", HighFive::create_datatype<SG::DataStructure::Common::Id>()},
      {"J", HighFive::create_datatype<SG::DataStructure::Common::I64>()},
      {"K", HighFive::create_datatype<SG::DataStructure::Common::I64>()},
      {"X", HighFive::create_datatype<SG::DataStructure::Common::Real>()},
      {"Y", HighFive::create_datatype<SG::DataStructure::Common::Real>()},
      {"TID", HighFive::create_datatype<SG::DataStructure::Common::Id>()},
      {"DOMAIN_ID",
       HighFive::create_datatype<SG::DataStructure::Common::Id>()}};
  return compoundType;
}
SG_DBMANAGER_HDF5_NAMESPACE_OPEN
class RANDPSRepository : public IRANDPSRepository,
                         public SG::DBManager::HDF5::SingleSetRepositoryBase<
                             SG::DataStructure::FEM::RANDPSData> {
 public:
  explicit RANDPSRepository(HDF5Database& database);

  void InitialDatasetInfo() override;
};
SG_DBMANAGER_HDF5_NAMESPACE_CLOSE
